package cn.qvtu.game.model;

import cn.qvtu.game.controller.EnemyController;
import cn.qvtu.game.util.StaticValue;
import java.awt.image.BufferedImage;
import java.util.List;

public class Enemy extends Person
{
    private Thread controllerThread;
    private List<BufferedImage> giftImgs;
    public Enemy(int x,int y,BackGround backGround)
    {
        super(x,y,backGround);
        this.status = -1;//设置状态为向左站立
        controllerThread = new Thread(new EnemyController(this,backGround));
        controllerThread.start();
    }
    /**
     * 设置敌人的图片
     */
    @Override
    protected void setImageList()
    {
        LeftStandImages = StaticValue.LeftEnemyImgs.subList(14,19);
        RightStandImages = StaticValue.RightEnemyImgs.subList(14,19);
        LeftRunImages = StaticValue.LeftEnemyImgs.subList(0,6);
        RightRunImages = StaticValue.RightEnemyImgs.subList(0,6);
        LeftJumpImages = StaticValue.LeftEnemyImgs.subList(4,5);
        RightJumpImages = StaticValue.RightEnemyImgs.subList(4,5);
        LeftAttackImages = StaticValue.LeftEnemyImgs.subList(6,14);
        RightAttackImages = StaticValue.RightEnemyImgs.subList(6,14);
    }
    public void dead()
    {
        this.backGround.getAllEnemy().remove(this);
        this.backGround.addTools(this.x+200,405);
        controllerThread.stop();
    }
}
